package org.springblade.modules.repair.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Sharry
 * @since 2024-08-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ElevatorRescueRobotSimpleVO extends ElevatorSimpleInfoVO {

	final static String DAYTIME_DESC = "06:00";

	final static String NIGHTTIME_DESC = "18:00";

	@ApiModelProperty(value = "救援时间要求 0-30分钟以内 1-特殊救援时间要求")
	private Integer rescueTime;

	@ApiModelProperty(value = "白天时间值（min）当天6:00~18:00")
	private Integer rescueDaytime;

	@ApiModelProperty(value = "晚上时间值（min）当天18：00~6：00")
	private Integer rescueNight;

	public String getRescueTimeDesc() {
		String rescueTimeDesc = "预计到达时间";
		if(new Integer(0).equals(rescueTime)){
			return rescueTimeDesc + "30分钟";
		}
		// 获取当前系统时间是否为 6:00-18:00
		String currentTime = new java.text.SimpleDateFormat("HH:mm").format(new java.util.Date());
		if(currentTime.compareTo(DAYTIME_DESC) >= 0 && currentTime.compareTo(NIGHTTIME_DESC) < 0){
			return rescueTimeDesc + rescueDaytime + "分钟";
		}
		return rescueTimeDesc + rescueNight + "分钟";
	}

}
